<?php
class Upload extends AppModel {
	var $name = 'Upload';
	var $actsAs = array(
				'FileUpload.FileUpload' => array(
					'uploadDir' => 'files',
					'forceWebroot' => true, //if false, files will be upload to the exact path of uploadDir
					'fields' => array('name' => 'name', 'type' => 'file_type', 'size' => 'file_size'),
					'allowedTypes' => array('pdf','zip','rar','gz','jpg','jpeg','png','gif','xml','xls','doc','xdoc'),
					'required' => false, //default is false, if true a validation error would occur if a file wsan't uploaded.
					'maxFileSize' => false, //bytes OR false to turn off maxFileSize (default false)
					'unique' => false, //filenames will overwrite existing files of the same name. (default true)
					'fileNameFunction' => 'sha1' //execute the Sha1 function on a filename before saving it (default false)
				)
			);

	public $hasAndBelongsToMany = array(
		'Article' => array(
			'className' => 'Article',
			'joinTable' => 'articles_uploads',
			'foreignKey' => 'upload_id',
			'associationForeignKey' => 'article_id',
			'unique' => 'keepExisting',
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'Domain' => array(
			'className' => 'Domain',
			'joinTable' => 'domains_uploads',
			'foreignKey' => 'domain_id',
			'associationForeignKey' => 'upload_id',
			'unique' => 'keepExisting',
			'conditions' => '',
			'fields' => '',
			'order' => '',
			'limit' => '',
			'offset' => '',
			'finderQuery' => '',
			'deleteQuery' => '',
			'insertQuery' => ''
		),
		'Gallery' => array(
					'className' => 'Gallery',
					'joinTable' => 'galleries_uploads',
					'foreignKey' => 'upload_id',
					'associationForeignKey' => 'gallery_id',
					'unique' => 'keepExisting',
					'conditions' => '',
					'fields' => '',
					'order' => '',
					'limit' => '',
					'offset' => '',
					'finderQuery' => '',
					'deleteQuery' => '',
					'insertQuery' => ''
		),
	);	
	

}
?>